export default {
	methods: {
		mergeColMethod({ row, _rowIndex, column, visibleData }) {
			const prevRow = visibleData[_rowIndex - 1];
			let nextRow = visibleData[_rowIndex + 1];
			if (column.property === 'machineName') {
				if (prevRow && prevRow.machineName === row.machineName) {
					return { rowspan: 0, colspan: 0 };
				} else {
					let countRowspan = 1;
					while (nextRow && nextRow.machineName === row.machineName) {
						nextRow = visibleData[++countRowspan + _rowIndex];
					}
					if (countRowspan > 1) {
						return { rowspan: countRowspan, colspan: 1 };
					}
				}
			}/* else if (column.property === 'machineOutputM') {
				if (prevRow && prevRow && prevRow.machineOutputM === row.machineOutputM && prevRow.machineName === row.machineName) {
					return { rowspan: 0, colspan: 0 };
				} else {
					let countRowspan = 1;
					while (nextRow && nextRow && nextRow.machineOutputM === row.machineOutputM && nextRow.machineName === row.machineName) {
						nextRow = visibleData[++countRowspan + _rowIndex];
					}
					if (countRowspan > 1) {
						return { rowspan: countRowspan, colspan: 1 };
					}
				}
			} else if (column.property === 'machineOutputKg') {
				if (prevRow && prevRow && prevRow.machineOutputKg === row.machineOutputKg && prevRow.machineName === row.machineName) {
					return { rowspan: 0, colspan: 0 };
				} else {
					let countRowspan = 1;
					while (nextRow && nextRow && nextRow.machineOutputKg === row.machineOutputKg && nextRow.machineName === row.machineName) {
						nextRow = visibleData[++countRowspan + _rowIndex];
					}
					if (countRowspan > 1) {
						return { rowspan: countRowspan, colspan: 1 };
					}
				}
			} else if (column.property === 'machineSingleSalary') {
				if (prevRow && prevRow && prevRow.machineSingleSalary === row.machineSingleSalary && prevRow.machineName === row.machineName) {
					return { rowspan: 0, colspan: 0 };
				} else {
					let countRowspan = 1;
					while (nextRow && nextRow && nextRow.machineSingleSalary === row.machineSingleSalary && nextRow.machineName === row.machineName) {
						nextRow = visibleData[++countRowspan + _rowIndex];
					}
					if (countRowspan > 1) {
						return { rowspan: countRowspan, colspan: 1 };
					}
				}
			} else if (column.property === 'energy') {
				if (prevRow && prevRow && prevRow.energy === row.energy && prevRow.machineName === row.machineName) {
					return { rowspan: 0, colspan: 0 };
				} else {
					let countRowspan = 1;
					while (nextRow && nextRow && nextRow.energy === row.energy && nextRow.machineName === row.machineName) {
						nextRow = visibleData[++countRowspan + _rowIndex];
					}
					if (countRowspan > 1) {
						return { rowspan: countRowspan, colspan: 1 };
					}
				}
			} else if (column.property === 'processTotalOutputKg') {
                    if (prevRow && prevRow && prevRow.processTotalOutputKg === row.processTotalOutputKg && prevRow.productionLineId === row.productionLineId && prevRow.processId === row.processId) {
                        return { rowspan: 0, colspan: 0 };
                    } else {
                        let countRowspan = 1;
                        while (nextRow && nextRow && nextRow.processTotalOutputKg === row.processTotalOutputKg && nextRow.productionLineId === row.productionLineId && nextRow.processId === row.processId) {
                            nextRow = visibleData[++countRowspan + _rowIndex];
                        }
                        if (countRowspan > 1) {
                            return { rowspan: countRowspan, colspan: 1 };
                        }
                    }
                } else if (column.property === 'empName') {
				if (prevRow && prevRow.empName && prevRow.empName === row.empName) {
					return { rowspan: 0, colspan: 0 };
				} else {
					let countRowspan = 1;
					while (nextRow && nextRow.empName && nextRow.empName === row.empName) {
						nextRow = visibleData[++countRowspan + _rowIndex];
					}
					if (countRowspan > 1) {
						return { rowspan: countRowspan, colspan: 1 };
					}
				}
			}*/
		}

	}
};
